<?php
/*
 * @Descripttion: 
 * @Author: Twoknives
 * @Date: 2022-02-09 17:13:50
 * @LastEditTime: 2022-02-09 17:29:38
 * @FilePath: \njz\app\api\model\MessageModel.php
 */

namespace app\api\model;

use think\Model;

use app\api\model\Token;

/**
 * 站内信
 */
class MessageModel extends Model
{

    protected $name='message';

    // 开启自动写入时间戳字段
    protected $auto_timestamp = 'false'; 

    // public function  getLastAddressTimeAttr($value, $data)
    // {
    //     return date('Y-m-d H:i:s', $data['last_address_time']);
    // }


    public function  getReadTimeAttr($value, $data)
    {
        if($data['read_time'] != 0){

            return date('Y-m-d H:i:s', $data['read_time']);
        }else{
            return $data['read_time'];
        }
    }

    public function  getSendTimeAttr($value, $data)
    {
        return date('Y-m-d H:i:s', $data['send_time']);
    }
  

}
